
//
//  ChangePassController.m
//  FinancialProduct
//
//  Created by Stella on 2017/8/31.
//  Copyright © 2017年 maq. All rights reserved.
//
#import "CKPuslichTool.h"
#import "PicPassController.h"
#import "ChangePicPassController.h"
#import "ChangeLoginPassController.h"
#import "MyAccountCell.h"
#import "ChangePassController.h"

@interface ChangePassController ()

@end

@implementation ChangePassController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 50;
    
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    
    return 1;
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    

    return 2;
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
 
    MyAccountCell *cell=[tableView dequeueReusableCellWithIdentifier:@"MyAccountCell" forIndexPath:indexPath];
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    cell.accessoryType=UITableViewCellAccessoryNone;
    if (indexPath.row==0) {
        cell.NameLabel.text=@"修改登录密码";
    }else{
        cell.NameLabel.text=@"修改手势密码";
    }
    
    cell.jiantou.hidden=NO;
    return cell;
    
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 0.01f;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 10.0;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0) {
        ChangeLoginPassController *vc=(ChangeLoginPassController *)[CKPuslichTool getViewControllerFromStroyBoard:@"Setting" viewID:@"ChangeLoginPassController"];
        [self.navigationController pushViewController:vc animated:YES];
    }else{
        NSString *oldPass=[[NSUserDefaults standardUserDefaults]objectForKey:@"PICPASSCODE"];
        if (oldPass.length>3) {
            ChangePicPassController *vc=(ChangePicPassController *)[CKPuslichTool getViewControllerFromStroyBoard:@"Setting" viewID:@"ChangePicPassController"];
            [self.navigationController pushViewController:vc animated:YES];
        }else{
            
            PicPassController *vc=(PicPassController *)[CKPuslichTool getViewControllerFromStroyBoard:@"Login" viewID:@"PicPassController"];
            vc.isFrome=@"Register";
            [self.navigationController pushViewController:vc animated:YES];
        }
    }
}


@end
